package com.starbaba.core.utils.json;


public class AjaxOutUtils {
	private static AjaxOutUtils instance;

	private AjaxOutUtils() {
	}

	public static AjaxOutUtils getInstance() {
		if (instance == null) {
			instance = new AjaxOutUtils();
		}
		return instance;
	}

	public String getSucessResult(String content) {
		StringBuffer result = new StringBuffer(128);
		result.append("{\"resultCode\":\"" + "0" + "\",");
		result.append(content + "}");
		return result.toString();
	}

	public String getSucessMsg(String content) {
		StringBuffer result = new StringBuffer(128);
		result.append("{\"resultCode\":\"" + "0" + "\",");
		result.append("\"resultSet\":\"" + content + "\"}");
		return result.toString();
	}

	public String getResultSet(String content) {
		StringBuffer result = new StringBuffer(128);
		result.append("{\"resultCode\":\"" + "0" + "\",");
		result.append("\"resultSet\":" + content + "}");
		return result.toString();
	}

	public String getFailureMsg(String content) {
		StringBuffer result = new StringBuffer(128);
		result.append("{\"resultCode\":\"" + "9" + "\",");
		result.append("\"msg\":\"" + content + "\"}");
		return result.toString();
	}
}
